package com.tongji.seller.command
{
	
	import com.tongji.seller.events.AddImageEvent;
	import com.tongji.seller.model.StoreProductModel;
	import com.tongji.seller.model.UserSceneModel;
	import com.tongji.seller.service.UserSceneService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 *
	 * @author caddy
	 * @date 2011-11-15
	 */
	public class AddImagesCommand extends Command
	{
		[Inject]
		public var service:UserSceneService;
		
		[Inject]
		public var event:AddImageEvent;
		
		[Inject]
		public var model:UserSceneModel;
		
		[Inject]
		public var model2:StoreProductModel;
		
		override public function execute():void
		{
			switch (event.type)
			{
				case AddImageEvent.ADD_IMAGES:
					service.addImages(event.images);
					break;
				case AddImageEvent.UPDATE_IMAGE:
					model.updateImage(event.images);
					break;
				case AddImageEvent.ADD_PNG_IMG:
					service.addPngImg(event.images);
					break;
				case AddImageEvent.UPDATE_PNG_IMG:
					model2.updatePngImg(event.images);
					break;
				
				default:break;
			}
		}	
	}
}